package cn.tedu.mvcboot1.controller;

import cn.tedu.mvcboot1.pojo.UserDTO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
public class UserController {
//   @RequestMapping("/v1/users/login")
//    @ResponseBody
//    public String login( HttpServletRequest request){
//       String username=request.getParameter("username");
//        String password=request.getParameter("password");
//        System.out.println(username+":"+password);
//        return username+":"+password;
//    }
//    @RequestMapping("/v1/users/login")
//    @ResponseBody
//    public String userLogin(String username,String password){
//        return username+":"+password;
//    }
    @RequestMapping("/v1/users/login")
    @ResponseBody
    public String userLogin(UserDTO userDTO){
        String username=userDTO.getUsername();
        String password=userDTO.getPassword();
        return username+":"+password;
    }

}
